<div ng-controller="bankController">
    <ol class="breadcrumb pull-right">
        <li><a ui-sref="app.home">汇票线</a></li>
        <li><a ui-sref="app.bank">银行管理</a></li>
        <li class="active">银行信息管理</li>
    </ol>

    <h1 class="page-header"><i class="fa fa-lg text-success fa-fax"></i>银行信息管理</h1>

    <div class="row">
        <div class="col-md-12">
            <div class="panel panel-inverse">
                <div class="panel-heading">
                    <div class="panel-heading-btn">
                        <a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-default" data-click="panel-expand"><i class="fa fa-expand"></i></a>
                        <a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-success" data-click="panel-reload"><i class="fa fa-repeat"></i></a>
                        <a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-warning" data-click="panel-collapse"><i class="fa fa-minus"></i></a>
                        <a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-danger" data-click="panel-remove"><i class="fa fa-times"></i></a>
                    </div>
                    <h4 class="panel-title">银行信息管理</h4>
                </div>
                <div class="panel-body">
                    <div class="form-inline filter-option">
                        <div class="row">
                            <div class="col-md-12">
                                <div class="pull-left">
                                    <select required="" class="form-control" ng-model="filter.HeadBankID" ng-options="item.id as item.bank_name for item in bankData" ng-change="reflash()">
                                        <option value="">总行名称</option>
                                    </select>
                                    <select required="" class="form-control" ng-model="filter.ProvinceID" ng-options="item.id as item.address_name for item in AddressData" ng-change="filterProvinceChange()">
                                        <option value="">省(直辖市)</option>
                                    </select>
                                    <select required="" class="form-control" ng-model="filter.CityID" ng-options="item.id as item.address_name for item in CityData" ng-change="reflash()">
                                        <option value="">市</option>
                                    </select>
                                </div>
                                <div class="pull-right">
                                    <input type="text" ng-model="filter.keyword" class="form-control input-sm" placeholder="关键词" />
                                    <button class="btn btn-sm btn-info" ng-click="reflash()"><i class="fa fa-search"></i> 筛选</button>
                                    <button class="btn btn-sm btn-success" ng-click="add()"><i class="fa fa-plus-circle"></i> 新增</button>
                                </div>
                            </div>
                        </div>
                    </div>
                    <table id="data-table" ng-table="tableParams" template-pagination="template/pagination.html" class="table table-striped table-bordered table-hover table-condensed">
                        <tr ng-repeat="item in $data">
                            <td data-title="'序号'" width="10%" class="text-center">{{ first + $index }}</td>
                            <td data-title="'总行ID'" width="10%" class="text-left">{{ item.head_bank_id }}</td>
                            <td data-title="'总行名称'" class="text-left">{{ item.head_bank_name }}</td>
                            <td data-title="'银行名称'" class="text-left">{{ item.bank_name }}</td>
                            <td data-title="'银行行号'" class="text-left">{{ item.bank_number }}</td>
                            <!--<td data-title="'银行地址ID'" class="text-left">{{ item.bank_address_id }}</td>
                            <td data-title="'银行所在地'" class="text-left">{{ item.bank_address }}</td>-->
                            <td data-title="'描述'" class="text-left">{{ item.description }}</td>
                            <td class="text-center width-100 text-nowrap">
                                <button class="btn btn-success btn-xs" ng-click="edit(item)"><i class="fa fa-edit"></i> 编辑</button>
                               <!-- <button class="btn btn-success btn-xs" ng-click="remove(item)"><i class="fa fa-trash-o"></i> 删除</button>-->
                            </td>
                        </tr>
                    </table>
                </div>
                <div class="modal fade" id="modal-edit">
                    <div class="modal-dialog">
                        <div class="modal-content">
                            <ng-form name="editForm" novalidate>
                                <div class="modal-header">
                                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                                    <h4 class="modal-title"><i class="fa fa-lg fa-edit text-success"></i>银行信息</h4>
                                </div>
                                <div class="modal-body">
                                    <div class="form-horizontal form-inline">
                                        <!--<div class="form-group width-full">
                                            <label class="col-md-3 control-label"><font color="red">*</font> 总行ID</label>
                                            <div class="col-md-8">
                                                <input type="text" name="head_bank_id" ng-model="model.head_bank_id" class="form-control width-full" required />
                                            </div>
                                        </div>
                                        <div class="form-group width-full" ng-class="{ 'has-error': editForm.head_bank_name.$invalid && !editForm.head_bank_name.$pristine }">
                                            <label class="col-md-3 control-label"><font color="red">*</font> 总行名称: </label>
                                            <div class="col-md-8">
                                                <input type="text" name="head_bank_name" ng-model="model.head_bank_name" class="form-control width-full" required />
                                            </div>
                                        </div>-->
                                        <div class="form-group width-full" ng-class="{ 'has-error': editForm.bank_name.$invalid && !editForm.bank_name.$pristine }">
                                            <label class="col-md-3 control-label"><font color="red">*</font> 银行名称: </label>
                                            <div class="col-md-8">
                                                <input type="text" name="bank_name" ng-model="model.bank_name" class="form-control width-full" required />
                                            </div>
                                        </div>
                                        <!--<div class="form-group width-full">
                                            <label class="col-md-3 control-label"><font color="red">*</font> 银行行号: </label>
                                            <div class="col-md-8">
                                                <input type="text" name="bank_number" ng-model="model.bank_number" class="form-control width-full" required />
                                            </div>
                                        </div>
                                        <div class="form-group width-full">
                                            <label class="col-md-3 control-label"><font color="red">*</font> 银行地址ID: </label>
                                            <div class="col-md-8">
                                                <input type="text" name="bank_address_id" ng-model="model.bank_address_id" class="form-control width-full" required />
                                            </div>
                                        </div>
                                        <div class="form-group width-full" ng-class="{ 'has-error': editForm.bank_address.$invalid && !editForm.bank_address.$pristine }">
                                            <label class="col-md-3 control-label"><font color="red">*</font> 银行所在地: </label>
                                            <div class="col-md-8">
                                                <input type="text" name="bank_address" ng-model="model.bank_address" class="form-control width-full" required />
                                            </div>
                                        </div>-->
                                        <div class="form-group width-full">
                                            <label class="col-md-3 control-label"> 描述: </label>
                                            <div class="col-md-8">
                                                <input type="text" name="description" ng-model="model.description" class="form-control width-full" />
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="modal-footer">
                                    <button type="submit" class="btn btn-sm btn-success" ng-click="save()" ng-disabled="editForm.$invalid"><i class="fa fa-save"></i> 保存</button>
                                    <button type="button" class="btn btn-sm btn-white" data-dismiss="modal"><i class="fa fa-share-square-o"></i> 关闭</button>
                                </div>
                            </ng-form>
                        </div>
                    </div>
                </div>
                <div class="modal fade" id="modal-add">
                    <div class="modal-dialog">
                        <div class="modal-content">
                            <ng-form name="addForm" novalidate>
                                <div class="modal-header">
                                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                                    <h4 class="modal-title"><i class="fa fa-lg fa-edit text-success"></i>银行信息</h4>
                                </div>
                                <div class="modal-body">
                                    <div class="form-horizontal form-inline">
                                        <div class="form-group width-full ">
                                            <label class="col-md-3 control-label"><font color="red">*</font> 总行名称: </label>
                                            <div class="col-md-8">
                                                <select required="" class="form-control" ng-model="model.head_bank_id" ng-options="item.id as item.bank_name for item in BankData">
                                                    <option value="">总行名</option>
                                                </select>
                                            </div>
                                        </div>
                                        <div class="form-group width-full ">
                                            <label class="col-md-3 control-label"><font color="red">*</font> 省市地址: </label>
                                            <div class="col-md-8">
                                                <select required="" style="margin-top:5px;" class="form-control" ng-model="model.bankprovince" ng-options="item.id as item.address_name for item in ProAddressData" ng-change="ProvinceChange()">
                                                    <option value="">省(直辖市)</option>
                                                </select>
                                                <select required="" style="margin-top:5px;" class="form-control" ng-model="model.bank_address_id" ng-options="item.id as item.address_name for item in BankCityData">
                                                    <option value="">市</option>
                                                </select>
                                            </div>
                                        </div>
                                        <!--<div class="form-group width-full">
                                            <label class="col-md-3 control-label"><font color="red">*</font> 总行ID</label>
                                            <div class="col-md-8">
                                                <input type="text" name="head_bank_id" ng-model="model.head_bank_id" class="form-control width-full" required />
                                            </div>
                                        </div>
                                        <div class="form-group width-full" ng-class="{ 'has-error': editForm.head_bank_name.$invalid && !editForm.head_bank_name.$pristine }">
                                            <label class="col-md-3 control-label"><font color="red">*</font> 总行名称: </label>
                                            <div class="col-md-8">
                                                <input type="text" name="head_bank_name" ng-model="model.head_bank_name" class="form-control width-full" required />
                                            </div>
                                        </div>
                                        -->
                                        <div class="form-group width-full">
                                            <label class="col-md-3 control-label"><font color="red">*</font> 银行行号: </label>
                                            <div class="col-md-8">
                                                <input type="text" name="bank_number" ng-model="model.bank_number" class="form-control width-full" required />
                                            </div>
                                        </div>
                                        <div class="form-group width-full" ng-class="{ 'has-error': editForm.bank_name.$invalid && !editForm.bank_name.$pristine }">
                                            <label class="col-md-3 control-label"><font color="red">*</font> 银行名称: </label>
                                            <div class="col-md-8">
                                                <input type="text" name="bank_name" ng-model="model.bank_name" class="form-control width-full" required />
                                            </div>
                                        </div>
                                        <!--<div class="form-group width-full">
                                            <label class="col-md-3 control-label"><font color="red">*</font> 银行地址ID: </label>
                                            <div class="col-md-8">
                                                <input type="text" name="bank_address_id" ng-model="model.bank_address_id" class="form-control width-full" required />
                                            </div>
                                        </div>
                                        <div class="form-group width-full" ng-class="{ 'has-error': editForm.bank_address.$invalid && !editForm.bank_address.$pristine }">
                                            <label class="col-md-3 control-label"><font color="red">*</font> 银行所在地: </label>
                                            <div class="col-md-8">
                                                <input type="text" name="bank_address" ng-model="model.bank_address" class="form-control width-full" required />
                                            </div>
                                        </div>-->
                                        <div class="form-group width-full">
                                            <label class="col-md-3 control-label"> 描述: </label>
                                            <div class="col-md-8">
                                                <input type="text" name="description" ng-model="model.description" class="form-control width-full" />
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="modal-footer">
                                    <button type="submit" class="btn btn-sm btn-success" ng-click="save()" ng-disabled="addForm.$invalid"><i class="fa fa-save"></i> 保存</button>
                                    <button type="button" class="btn btn-sm btn-white" data-dismiss="modal"><i class="fa fa-share-square-o"></i> 关闭</button>
                                </div>
                            </ng-form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

